#!/usr/bin/env python
# -*- coding:utf-8 -*-
'''=================================================
@Project :quant_statistical
@FileName:flask_demo
@Python  :Python 3.7+
@Time    :2021/11/18/0018 18:19:57
@Desc    :
=================================================='''
from flask import Flask
from little_demo.bus import get_bus_info

app = Flask(__name__)


@app.route('/')
def index():
    return {
        "msg": "success",
        "data": "welcome to use flask."
    }


@app.route('/user/<u_id>')
def user_info(u_id):
    return {
        "msg": "success",
        "data": {
            "id": u_id,
            "username": 'yuz',
            "age": 18
        }
    }


@app.route('/bus/<station>')
def bus_info(station):
    info = get_bus_info(station)
    return {
        "msg": "success",
        "data": info
    }


if __name__ == "__main__":
    app.run()
